<?php
/* @var $this OrcamentoController */
/* @var $model Orcamento */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'orcamento-form',
	'enableAjaxValidation'=>false,
)); 


$pessoa = new Pessoa;
$produto = new Produto;
$servico = new Servico;
?>

	<p class="note">Campos com <span class="required">*</span> s&#227;o de preenchimento obrigat&#243;rio.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'ide_pessoa'); ?>
		<?php echo $form->dropDownList($model, 'ide_pessoa',CHtml::listData(pessoa::model()->findAll(),'ide_pessoa','nome'),array('empty'=>'.:Selecione:.')); ?>
		<?php echo $form->error($model,'ide_pessoa'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'dtc_orcamento'); ?>
		<?php 
			  $this->widget('zii.widgets.jui.CJuiDatePicker',array(
							'attribute'=>'dtc_orcamento',
							'model'=>$model,
							'language'=>'pt-Br',
							'options'=>array(
									'dateFormat'=>'dd/mm/yy',
									'onSelect'=>'function(date){$.post("controlller/agenda",{"date":date})}',  
							),
						 ));
			  
		?>
		<?php echo $form->error($model,'dtc_orcamento'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ide_produto'); ?>
		<?php echo $form->listBox($model, 'ide_produto', CHtml::listData(produto::model()->findAll(),
																			'ide_produto','nm_produto')); 
		?>
		<?php echo $form->error($model,'ide_produto'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ide_servico'); ?>
		<?php echo $form->listBox($model, 'ide_servico', CHtml::listData(servico::model()->findAll(),
																			'ide_servico','nm_servico')); ?>
		<?php echo $form->error($model,'ide_servico'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'val_orcamento'); ?>
		<?php echo $form->textField($model,'val_orcamento',array('size'=>10,'maxlength'=>10));?>
		<?php echo $form->error($model,'val_orcamento'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Incluir' : 'Atualizar'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->